package com.demo.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

       //对应数据库中的主键
       /*type的值:  AUTO(0),  代表数据库id自增 (一般使用这个 )
           NONE(1),          未设置主键
           INPUT(2),         手动输入id
           ID_WORKER(3),     默认的全局id
           UUID(4),         全局唯一id
           ID_WORKER_STR(5);  字符串表示id
              */
       @TableId(type = IdType.AUTO)
       private Long id;
       private String name;
       private Integer age;
       private String email;

       @TableLogic //逻辑删除
       private Integer delete;

       @Version //乐观锁的version注解
       private Integer version;

       @TableField(fill = FieldFill.INSERT)
       private Date createTime;
       @TableField(fill = FieldFill.INSERT_UPDATE)
       private Date updateTime;

}
